home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / PageMaker 6.5 SDK Mac / SourceCode / PageMakerClassLibrary / LowLevel / PRequestBuf.h < prev    next >
C/C++ Source or Header  |  1996-09-05  |  1KB  |  53 lines

  1. /*
  2.  *--- PRequestBuf.h -------------------------------------------------------
  3.  * Copyright (c) 1995-96 Adobe Systems Incorporated.  All rights reserved.
  4.  * Created on Thu, Oct 19, 1995 @ 8:17 PM by Paul Ferguson.
  5.  *-------------------------------------------------------------------------
  6.  */
  7. #ifndef __PRequestBuf__
  8. #define __PRequestBuf__
  9.  
  10. #include <string.h>
  11. #ifdef __MWERKS__
  12. #pragma once
  13. #endif
  14.  
  15. #include "PMTypes.h"
  16.  
  17. class PRequestBuf
  18. {
  19. public:
  20.  
  21.     PRequestBuf(size_t size);
  22.     PRequestBuf(void * h);
  23.  
  24.     virtual ~PRequestBuf();
  25.  
  26.     PRequestBuf& operator<< (short aShort);
  27.     PRequestBuf& operator<< (unsigned short aShort);
  28.     PRequestBuf& operator<< (long aLong);
  29.     PRequestBuf& operator<< (unsigned long aLong);    
  30.     PRequestBuf& operator<< (const char * aString);                // C string
  31.     PRequestBuf& operator<< (const unsigned char * aString);    // Pascal string
  32.     PRequestBuf& operator<< (PRequestBuf& aBuf);                // Append a buffer
  33.  
  34.     operator const char *() const { return bufPtr; }
  35.     
  36.     size_t        Size() const { return (long) curCh - (long) bufPtr; }
  37.     
  38. protected:
  39.  
  40. private:
  41.  
  42.     char         * bufHdl;
  43.     char        * curCh;        
  44.     char        * bufPtr;        // this should not change after construction
  45.     
  46.     PRequestBuf(PRequestBuf&);
  47.     PRequestBuf& operator=(const PRequestBuf&);
  48. };
  49.  
  50. #endif
  51.  
  52. // end of PRequestBuf.h
  53.